﻿@model Sheng.WeixinConstruction.Client.Shell.Models.PictureVoteViewModel

@{
    ViewBag.SubTitle = "活动";
    Layout = "~/Views/Shared/_LayoutBlank.cshtml";
}

<style type="text/css">
    body {
        margin-bottom: 0.55rem;
    }

    .campaignName {
        font-size: 0.14rem;
        font-weight: bold;
    }

    .campaignDescription {
        font-size: 0.13rem;
        color: #666;
    }

    #divMemberInfo {
        font-size: 0.14rem;
        line-height: 0.14rem;
        text-align: center;
        margin-top: 0.05rem;
    }

    .divPictureVoteItemImage {
        height: 1.3rem;
        width: 100%;
        border: 1px solid #CCC;
        display: table;
        text-align: center;
    }

    .divPictureVoteItemImageContent {
        vertical-align: middle;
        display: table-cell;
    }

    .imgPictureVoteItem {
        max-height: 1.24rem;
        max-width: 100%;
        vertical-align: middle;
    }



    .divPictureVoteItemTitle {
        font-weight: bold;
        font-size: 0.14rem;
        padding-top: 0.02rem;
        padding-right: 0.03rem;
        padding-bottom: 0.02rem;
        padding-left: 0.03rem;
    }

    .divPictureVoteItemDescription {
        font-size: 0.13rem;
        padding-top: 0.02rem;
        padding-right: 0.03rem;
        padding-bottom: 0.02rem;
        padding-left: 0.03rem;
        color: #808080;
    }

    .divPictureVoteItemMember {
        font-size: 0.13rem;
        padding-top: 0.02rem;
        padding-right: 0.03rem;
        padding-bottom: 0.02rem;
        padding-left: 0.03rem;
        margin-top: 0.04rem;
    }

    .divPictureVoteItemVoteQuantity {
        padding-top: 0rem;
        padding-right: 0.03rem;
        padding-bottom: 0rem;
        padding-left: 0.03rem;
        margin-top: 0.01rem;
        font-size: 0.13rem;
        margin-top: 0.04rem;
    }

    #divShareMask {
        position: absolute;
        top: 0px;
        bottom: 0px;
        left: 0px;
        right: 0px;
        width: 100%;
        height: 100%;
        background-color: black;
        text-align: right;
        filter: alpha(opacity=80);
        -moz-opacity: 0.8;
        -khtml-opacity: 0.8;
        opacity: 0.8;
    }

    #divFooter {
        position: fixed;
        bottom: 0px;
        left: 0px;
        right: 0px;
        height: 0.4rem;
        font-size: 0.14rem;
        text-align: center;
        background-color: #F5F5F5;
    }
</style>

<script>

    //当前页
    var _orderBy = "UploadTime";
    var _currentPage = 1;
    var _totalPage = 1;
    var _status = @((int)Model.CampaignBundle.Campaign.Status);
    var _allowedNewItem = @(Model.CampaignBundle.PictureVote.AllowedNewItem.ToString().ToLower());
    var _fullParticipant = @(Model.FullParticipant.ToString().ToLower());
    var _campaignId= getQueryString("campaignId");

    $(document).ready(function ()
    {
        $(document).scroll(function ()
        {
            $("#divShareMask").css("top", document.body.scrollTop);
        });

        var jsApiConfigStr = "@Newtonsoft.Json.JsonConvert.SerializeObject(Model.JsApiConfig)";
        jsApiConfigStr = jsApiConfigStr.replace(new RegExp("&quot;", "gm"), "\"");
        jsApiConfigStr = jsApiConfigStr.replace(new RegExp("\r\n", "gm"), "");
        jsApiConfigStr = jsApiConfigStr.replace(new RegExp("\n", "gm"), "");
        var jsApiConfig = eval('(' + jsApiConfigStr + ')');

        wx.config(jsApiConfig);

        loadData();
    });

    wx.ready(function ()
    {
        wx.onMenuShareTimeline({
            title: '@Model.CampaignBundle.Campaign.ShareTimelineTitle', // 分享标题
            link: '@Request.Url.ToString()', // 分享链接
            imgUrl: '@Model.CampaignBundle.Campaign.ShareImageUrl', // 分享图标
            success: function ()
            {
                shareSuccess("PictureVoteShareTimeline");
            },
            cancel: function ()
            {
                // 用户取消分享后执行的回调函数
            }
        });

        wx.onMenuShareAppMessage({
            title: '@Model.CampaignBundle.Campaign.ShareAppMessageTitle', // 分享标题
            desc: '@Model.CampaignBundle.Campaign.ShareAppMessageDescription', // 分享描述
            link: '@Request.Url.ToString()', // 分享链接
            imgUrl: '@Model.CampaignBundle.Campaign.ShareImageUrl', // 分享图标
            type: 'link', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function ()
            {
                shareSuccess("PictureVoteShareAppMessage");
            },
            cancel: function ()
            {
                // 用户取消分享后执行的回调函数
            }
        });
    });

    wx.error(function (res)
    {
        alert("error:" + res);
    });

    function shareSuccess(type)
    {
        var loadLayerIndex = layer.open({
            type: 2,
            shadeClose: false,
            content: '请稍候...'
        });

        $.ajax({
            url: "/Api/Campaign/" + type + "/@ViewBag.Domain.Id?campaignId=" + _campaignId,
            type: "POST",
            dataType: "json",
            success: function (data, status, jqXHR)
            {
                // alert(data);

                layer.close(loadLayerIndex);
                if (data.Success)
                {
                    var resultObj = data.Data;

                    if (resultObj.Point == 0 && resultObj.Vote == 0)
                        return;

                    var msg = "";
                    if (resultObj.Point > 0)
                    {
                        msg += "获得积分：" + resultObj.Point;
                    }
                    if (resultObj.Vote > 0)
                    {
                        if (msg != "")
                        {
                            msg += "<br/>";
                        }

                        msg += "您参与的内容获得系统为您投票：" + resultObj.Vote + " 票/每项";
                    }
                    if (msg != "")
                    {
                        layerAlertBtn(msg);
                    }

                } else
                {
                    layerAlert(data.Message);
                }
            },
            error: function (xmlHttpRequest)
            {
                layer.close(loadLayerIndex);
                //alert("Error: " + xmlHttpRequest.status);
            }
        });
    }

    function loadDataByTime(){

        $("#divOrderByTime").attr("class","divRectangle");
        $("#divOrderByVoteCount").attr("class","divRectangle_Gray");

        _orderBy = "UploadTime";
        loadData();
    }

    function loadDataByVoteQuantity(){

        $("#divOrderByTime").attr("class","divRectangle_Gray");
        $("#divOrderByVoteCount").attr("class","divRectangle");

        _orderBy = "VoteQuantity";
        loadData();
    }

    function loadData(targetPage)
    {
        if (targetPage > _totalPage)
            return;

        var loadLayerIndex = layer.open({
            type: 2,
            shadeClose: false,
            content: '请稍候...'
        });

        var args = new Object();
        args.Page = targetPage || 1;
        args.PageSize = 10;
        args.OrderBy = _orderBy;

        if(_status==2)
        {
            args.OrderBy = "VoteQuantity";
        }

        $.ajax({
            url: "/Api/Campaign/GetPictureVoteItemList/@ViewBag.Domain.Id?campaignId=" + _campaignId,
            type: "POST",
            dataType: "json",
            data: JSON.stringify(args),
            success: function (data, status, jqXHR)
            {
                // alert(data);

                layer.close(loadLayerIndex);
                if (data.Success)
                {
                    var resultObj = data.Data;

                    _currentPage = resultObj.Page;
                    _totalPage = resultObj.TotalPage;
                    if (_currentPage >= _totalPage)
                    {
                        $("#divPagingContainer").html("没有更多了");
                    }

                    if(_currentPage==1)
                    {
                        document.getElementById('pictureVoteItemContainer').innerHTML = "";
                    }

                    if(_status == 2)
                    {
                        var gettpl = document.getElementById('endPictureVoteItemListTemplate').innerHTML;
                        laytpl(gettpl).render(resultObj.ItemList, function (html)
                        {
                            document.getElementById('pictureVoteItemContainer').innerHTML += html;
                        });
                    }else
                    {
                        var gettpl = document.getElementById('pictureVoteItemListTemplate').innerHTML;
                        laytpl(gettpl).render(resultObj.ItemList, function (html)
                        {
                            document.getElementById('pictureVoteItemContainer').innerHTML += html;
                        });
                    }

                } else
                {
                    layerAlert(data.Message);
                }
            },
            error: function (xmlHttpRequest)
            {
                layer.close(loadLayerIndex);
                //alert("Error: " + xmlHttpRequest.status);
            }
        });
    }

    function searchBySerialNumber()
    {
        var serialNumber = $("#txtSerialNumber").val();
        if (serialNumber == "")
            return;

        var loadLayerIndex = layer.open({
            type: 2,
            shadeClose: false,
            content: '请稍候...'
        });

        $.ajax({
            url: "/Api/Campaign/GetPictureVoteItemIdBySerialNumber/@ViewBag.Domain.Id?serialNumber=" + serialNumber,
            type: "POST",
            dataType: "json",
            success: function (data, status, jqXHR)
            {
                layer.close(loadLayerIndex);
                if (data.Success)
                {
                    showItemDetail(data.Data);
                } else
                {
                    layerAlert(data.Message);
                }
            },
            error: function (xmlHttpRequest)
            {
                layer.close(loadLayerIndex);
                //alert("Error: " + xmlHttpRequest.status);
            }
        });
    }

    function showItemDetail(itemId)
    {
        var loadLayerIndex = layer.open({
            type: 2,
            shadeClose: false,
            content: '请稍候...'
        });

        $.ajax({
            url: "/Api/Campaign/GetPictureVoteItem/@ViewBag.Domain.Id?itemId=" + itemId,
            type: "POST",
            dataType: "json",
            success: function (data, status, jqXHR)
            {
                layer.close(loadLayerIndex);
                if (data.Success)
                {
                    var resultObj = data.Data;

                    //alert(JSON.stringify(resultObj));
                    var gettpl = document.getElementById('itemDetailTemplate').innerHTML;
                    laytpl(gettpl).render(resultObj, function (html)
                    {
                        var pageii = layer.open({
                            type: 1,
                            content: html,
                            shadeClose: false,
                            style: 'position:fixed; left:0.1rem; top:0.1rem;right:0.1rem; bottom:0.1rem; border:none;'
                        });
                    });

                } else
                {
                    layerAlert(data.Message);
                }
            },
            error: function (xmlHttpRequest)
            {
                layer.close(loadLayerIndex);
                //alert("Error: " + xmlHttpRequest.status);
            }
        });

    }

    function showCampaignDescription()
    {


        var loadLayerIndex = layer.open({
            type: 2,
            shadeClose: false,
            content: '请稍候...'
        });

        $.ajax({
            url: "/Api/Campaign/GetCampaignDescription/@ViewBag.Domain.Id?id=" + _campaignId,
            type: "POST",
            dataType: "json",
            success: function (data, status, jqXHR)
            {
                layer.close(loadLayerIndex);
                if (data.Success)
                {
                    var resultObj = data.Data;

                    var gettpl = document.getElementById('campaignDescription').innerHTML;

                    laytpl(gettpl).render(resultObj, function (html)
                    {
                        var pageii = layer.open({
                            type: 1,
                            content: html,
                            shadeClose: false,
                            style: 'position:fixed; left:0.1rem; top:0.1rem;right:0.1rem; bottom:0.1rem; border:none;'
                        });
                    });

                } else
                {
                    layerAlert(data.Message);
                }
            },
            error: function (xmlHttpRequest)
            {
                layer.close(loadLayerIndex);
                //alert("Error: " + xmlHttpRequest.status);
            }
        });

    }

    function upload()
    {
        if(_status == 2){
            layerAlert("本活动已经结束。");
            return;
        }

        if(_allowedNewItem == false){
            layerAlert("参与通道已关闭。");
            return;
        }

        if(_fullParticipant){
            layerAlert("该活动已达最大允许参与人数。");
            return;
        }


        @if (Model.Attention == false)
        {
            <text>
        layerAlertBtn("请先关注我们才可以参与哦~", function ()
        {
            window.location.href = '/Home/CampaignGuideSubscribe/@ViewBag.Domain.Id?campaignId=' + _campaignId;
        });
        </text>
        }
        else
        {
             <text>
        window.location.href = "/Campaign/PictureVoteUpload/@ViewBag.Domain.Id?campaignId=" + _campaignId;
        </text>
        }
    }

    function detail(){
        @if (Model.PictureVoteItem != null)
         {
             <text>
        window.location.href = "/Campaign/PictureVoteItemDetail/@ViewBag.Domain.Id?campaignId=" + _campaignId + "&itemId=@Model.PictureVoteItem.Id";
        </text>
    }
    }

    function vote(itemId)
    {
        var confirmIndex = layer.open({
            content: '确认为Ta投上一票吗？',
            btn: ['确认', '取消'],
            shadeClose: true,
            yes: function ()
            {
                layer.close(confirmIndex);

                var loadLayerIndex = layer.open({
                    type: 2,
                    shadeClose: false,
                    content: '请稍候...'
                });

                $.ajax({
                    url: "/Api/Campaign/PictureVote/@ViewBag.Domain.Id?campaignId=" + _campaignId + "&itemId=" + itemId,
                    type: "POST",
                    dataType: "json",
                    success: function (data, status, jqXHR)
                    {
                        layer.close(loadLayerIndex);
                        if (data.Success)
                        {
                            var msg = "";
                            switch (data.Data)
                            {
                                case 0:
                                    msg = "投票成功！";
                                    var oldQuantity = parseInt($(".quantity" + itemId).html());
                                    $(".quantity" + itemId).html(oldQuantity + 1);
                                    break;
                                case 1:
                                    msg = "投票失败。";
                                    break;
                                case 2:
                                    msg = "该活动已经结束了。";
                                    break;
                                case 3:
                                    msg = "该活动还没开始。";
                                    break;
                                case 4:
                                    msg = "您已经为Ta投过票啦~";
                                    break;
                                case 5:
                                    msg = "您手中已没有更多的选票了~";
                                    break;
                                case 6:
                                    msg = "请先关注我们才可以投票~";
                                    break;
                                case 7:
                                    msg = "该项目已被锁定。";
                                    break;
                                case 8:
                                    msg = "今天您手中已没有更多的选票了，请明天再来~";
                                    break;
                                case 9:
                                    msg = "今天您已经为Ta投过票啦，请明天再来~";
                                    break;
                                default:
                                    msg = "未知错误";
                                    break;
                            }
                            if (data.Data == 6)
                            {
                                layerAlertBtn(msg, function ()
                                {
                                    window.location.href = '/Home/CampaignGuideSubscribe/@ViewBag.Domain.Id?campaignId=' + _campaignId;
                                });
                            } else
                            {
                                layerAlert(msg);
                            }

                        } else
                        {
                            layerAlert(data.Message);
                        }
                    },
                    error: function (xmlHttpRequest)
                    {
                        layer.close(loadLayerIndex);
                        //alert("Error: " + xmlHttpRequest.status);
                    }
                });
            }
        });
    }

    function showLockMessage()
    {
        layerAlert("该项目已被锁定。");
    }

    function showShareMask()
    {
        $("#divShareMask").css("top", document.body.scrollTop);
        $("#divShareMask").show();

        $("#divFooter").hide();
    }

    function hideShareMask()
    {
        $("#divShareMask").hide();

        $("#divFooter").show();
    }

</script>

<script id="pictureVoteItemListTemplate" type="text/html">
    {{# for(var i = 0, len = d.length; i < len; i=i+2){ }}

    <div class="divDotLine" style="margin-top: 0.05rem; margin-bottom: 0.1rem;">
    </div>

    <div>
        <div style="float: left; width: 50%;">
            <div style="margin-left: 0px; margin-right: 0.03rem;">
                <div class="divPictureVoteItemImage" onclick="showItemDetail('{{ d[i].Id }}')">
                    <div class="divPictureVoteItemImageContent">
                        <img src="{{ d[i].Url }}" class="imgPictureVoteItem">
                    </div>
                </div>
                <div style="margin-top: 0.05rem;">
                    <div class="divPictureVoteItemTitle">{{ d[i].Title }}</div>
                    <div class="divPictureVoteItemMember">{{ d[i].MemberNickName }}</div>
                    <div class="divPictureVoteItemMember">编号：{{ d[i].SerialNumber }}</div>
                    <div class="divPictureVoteItemVoteQuantity">当前票数：<span class="font_red_b quantity{{ d[i].Id }}">{{ d[i].VoteQuantity }}</span></div>

                    {{# if(d[i].Lock == true){ }}
                    <div class="divRectangle_Gray" style="margin-top:0.1rem;" onclick="showLockMessage()">
                        锁定
                    </div>
                    {{# }else{ }}
                    <div class="divRectangle" style="margin-top:0.1rem;" onclick="vote('{{ d[i].Id }}')">
                        投Ta一票
                    </div>
                    {{# } }}
                </div>
            </div>
        </div>

        {{# if(d[i+1] != undefined){ }}
        <div style="float: left; width: 50%;">
            <div style="margin-left: 0.03rem; margin-right: 0px;">
                <div class="divPictureVoteItemImage" onclick="showItemDetail('{{ d[i+1].Id }}')">
                    <div class="divPictureVoteItemImageContent">
                        <img src="{{ d[i+1].Url }}" class="imgPictureVoteItem">
                    </div>
                </div>
                <div style="margin-top: 0.05rem;">
                    <div class="divPictureVoteItemTitle">{{ d[i+1].Title }}</div>
                    <div class="divPictureVoteItemMember">{{ d[i+1].MemberNickName }}</div>
                    <div class="divPictureVoteItemMember">编号：{{ d[i+1].SerialNumber }}</div>
                    <div class="divPictureVoteItemVoteQuantity">当前票数：<span class="font_red_b quantity{{ d[i+1].Id }}">{{ d[i+1].VoteQuantity }}</span></div>

                    {{# if(d[i+1].Lock == true){ }}
                    <div class="divRectangle_Gray" style="margin-top:0.1rem;" onclick="showLockMessage()">
                        锁定
                    </div>
                    {{# }else{ }}
                    <div class="divRectangle" style="margin-top:0.1rem;" onclick="vote('{{ d[i+1].Id }}')">
                        投Ta一票
                    </div>
                    {{# } }}

                </div>

            </div>
        </div>
        {{# } }}

        <div style="clear: both"></div>
    </div>

    {{# } }}

</script>

<script id="endPictureVoteItemListTemplate" type="text/html">
    {{# for(var i = 0, len = d.length; i < len; i=i+2){ }}

    <div class="divDotLine" style="margin-top: 0.05rem; margin-bottom: 0.1rem;">
    </div>

    <div>
        <div style="float: left; width: 50%;">
            <div style="margin-left: 0px; margin-right: 0.03rem;">
                <div>
                    [ 第 {{# var ranking = i+1 + (_currentPage-1) * 10 }}{{ranking}} 名 ]
                </div>
                <div class="divPictureVoteItemImage" onclick="showItemDetail('{{ d[i].Id }}')">
                    <div class="divPictureVoteItemImageContent">
                        <img src="{{ d[i].Url }}" class="imgPictureVoteItem">
                    </div>
                </div>
                <div style="margin-top: 0.05rem;">
                    <div class="divPictureVoteItemTitle">{{ d[i].Title }}</div>
                    <div class="divPictureVoteItemMember">{{ d[i].MemberNickName }}</div>
                    <div class="divPictureVoteItemMember">编号：{{ d[i].SerialNumber }}</div>
                    <div class="divPictureVoteItemVoteQuantity">票数：<span class="font_red_b quantity{{ d[i].Id }}">{{ d[i].VoteQuantity }}</span></div>
                </div>
            </div>
        </div>

        {{# if(d[i+1] != undefined){ }}
        <div style="float: left; width: 50%;">
            <div style="margin-left: 0.03rem; margin-right: 0px;">
                <div>
                    [ 第 {{# var ranking = i+2 + (_currentPage-1) * 10 }}{{ranking}} 名 ]
                </div>
                <div class="divPictureVoteItemImage" onclick="showItemDetail('{{ d[i+1].Id }}')">
                    <div class="divPictureVoteItemImageContent">
                        <img src="{{ d[i+1].Url }}" class="imgPictureVoteItem">
                    </div>
                </div>
                <div style="margin-top: 0.05rem;">
                    <div class="divPictureVoteItemTitle">{{ d[i+1].Title }}</div>
                    <div class="divPictureVoteItemMember">{{ d[i+1].MemberNickName }}</div>
                    <div class="divPictureVoteItemMember">编号：{{ d[i+1].SerialNumber }}</div>
                    <div class="divPictureVoteItemVoteQuantity">票数：<span class="font_red_b quantity{{ d[i+1].Id }}">{{ d[i+1].VoteQuantity }}</span></div>
                </div>

            </div>
        </div>
        {{# } }}

        <div style="clear: both"></div>
    </div>

    {{# } }}

</script>

<script type="text/html" id="campaignDescription">
    <div style="position: fixed; top: 0.1rem; left: 0.1rem; right: 0.1rem; bottom: 0.45rem; overflow: auto;">
        {{ d }}
    </div>
    <div style="position: fixed; bottom: 0.1rem; left: 0.1rem; right: 0.1rem;">
        <div class="divRectangle_Gray" style="margin-top: 0.1rem; " onclick="layer.closeAll()">
            关 闭
        </div>
    </div>
</script>

<script type="text/html" id="itemDetailTemplate">
    <div style="position: fixed; top: 0.1rem; left: 0.1rem; right: 0.1rem; bottom: 0.9rem; overflow: auto">
        <div>
            <img src="{{ d.Url }}" style="width: 100%">
        </div>
        <div class="divPictureVoteItemTitle" style="margin-top: 0.1rem;">{{ d.Title }}</div>
        <div class="divPictureVoteItemMember" style="margin-top: 0.1rem;">上传者：{{ d.MemberEntity.NickName }}</div>
        <div class="divPictureVoteItemMember" style="margin-top: 0.1rem;">编号：{{ d.SerialNumber }}</div>
        <div class="divPictureVoteItemVoteQuantity">当前票数：<span class="font_red_b quantity{{ d.Id }}">{{ d.VoteQuantity }}</span></div>
        <div class="divPictureVoteItemDescription" style="margin-top: 0.1rem;">
            {{ d.Description }}
        </div>
    </div>
    <div style="position: fixed; bottom: 0.1rem; left: 0.1rem; right: 0.1rem;">
        {{# if(_status == 1){ }}
        {{# if(d.Lock == true){ }}
        <div class="divRectangle_Gray" style="margin-top: 0.1rem;" onclick="showLockMessage()">
            锁定
        </div>
        {{# }else{ }}
        <div class="divRectangle" style="margin-top: 0.1rem;" onclick="vote('{{ d.Id }}')">
            投Ta一票
        </div>
        {{# } }}
        {{# } }}

        <div class="divRectangle_Gray" style="margin-top: 0.1rem; " onclick="layer.closeAll()">
            再看看
        </div>
    </div>
</script>


<div id="divImageContainer">
    <img src="@Model.CampaignBundle.Campaign.ImageUrl" name="img" id="img" style="width: 100%;">
</div>

<div class="divContent">
    <div style="margin-top: 0.06rem" class="campaignName">
        @Model.CampaignBundle.Campaign.Name
    </div>
    <div style="margin-top: 0.06rem" class="campaignDescription">
        @Html.Raw(Model.CampaignBundle.Campaign.Introduction)
    </div>

    @*<div style="text-align: center">
            <div class="divVoteButton" style="margin-top: 0.1rem;" onclick="showCampaignDescription()">
                查看活动详情/兑奖说明
            </div>
        </div>*@

    @if (Model.PictureVoteItem != null && Model.PictureVoteItem.ApproveStatus == Sheng.WeixinConstruction.Infrastructure.EnumCampaignPictureVoteItemApproveStatus.Rejected)
    {
        <div style="margin-top:0.15rem;padding-left:0.1rem;padding-right:0.1rem; padding-top:0.1rem;padding-bottom:0.1rem;
            background-color:#FFF2E6;border: 1px solid #FF9673;">
            您上传的照片被拒绝，请点击右下角“查看我的”，删除并重新上传。
            <br />原因：@Model.PictureVoteItem.RejectedMessage
        </div>
    }

    <div class="divDotLine" style="margin-top: 0.1rem; margin-bottom: 0.1rem;">
    </div>

    <div style="text-align: center; margin-top: 0.1rem;">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="33%" align="center">
                    参与人数<br />
                    <span class="defaultColor" style="font-weight:bold">@Model.DataReport.ApprovedItemsCount</span>
                </td>
                <td width="33%" align="center">
                    总投票数<br />
                    <span class="defaultColor" style="font-weight:bold">@Model.DataReport.VoteQuantityCount</span>
                </td>
                <td width="33%" align="center">
                    围观次数<br />
                    <span class="defaultColor" style="font-weight:bold">@Model.DataReport.PageVisitCount</span>
                </td>
            </tr>
        </table>
    </div>
    <div class="divDotLine" style="margin-top: 0.05rem; margin-bottom: 0.1rem;">
    </div>
    <div id="divMemberInfo" onclick="showShareMask()">
        <table border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td align="left" style="width: 0.3rem">
                    <img src="/Content/Images/shareTimeLine.jpg" style="width: 0.2rem;">
                </td>
                <td>
                    <div>点击这里分享本页试一试~</div>
                </td>
            </tr>
        </table>
    </div>

    <div class="divDotLine" style="margin-top: 0.05rem; margin-bottom: 0.1rem;">
    </div>
    <div>
        <table border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td align="left" style="width: 0.5rem">编号：</td>
                <td>
                    <input id="txtSerialNumber" name="txtSerialNumber" type="text" class="input_16" style="width: 95%" />
                </td>
                <td style="width: 0.7rem">
                    <input name="" type="button" class="button" value="查看" style="width:90%" onclick="searchBySerialNumber()">
                </td>
            </tr>
        </table>
    </div>

    @if (Model.CampaignBundle.Campaign.Status == Sheng.WeixinConstruction.Infrastructure.EnumCampaignStatus.Ongoing)
    {
        <div style="margin-top: 0.15rem; font-size: 0.14rem; text-align: center;">
            <table border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                    <td>
                        <div id="divOrderByTime" class="divRectangle" onclick="loadDataByTime()">
                            时间排序
                        </div>
                    </td>
                    <td style="width: 0.1rem;">&nbsp;</td>
                    <td>
                        <div id="divOrderByVoteCount" class="divRectangle_Gray" onclick="loadDataByVoteQuantity()">
                            名次排序
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    }

    <div id="divShareMask" style="display: none" onclick="hideShareMask()">
        <img src="/Content/Images/share.PNG" width="200" height="145">
    </div>

    <div id="pictureVoteItemContainer" style="margin-top: 0.06rem">
    </div>

    <div id="divPagingContainer" class="divPagingContainer" style="margin-top: 0.2rem; text-align: center" onclick="loadData(_currentPage+1)">
        查看更多
    </div>

</div>

<div id="divFooter">
    <table align="center" border="0" style="height:100%;width:100%">
        <tr>
            <td valign="middle" align="center" width="50%">
                <input name="" type="button" class="button" value="活动说明" style="width:90%" onclick="showCampaignDescription()">
            </td>
            <td valign="middle" align="center" width="50%">
                @if (Model.CampaignBundle.Campaign.Status == Sheng.WeixinConstruction.Infrastructure.EnumCampaignStatus.Ongoing)
                {
                    if (Model.PictureVoteItem == null)
                    {
                        <input name="" type="button" class="button" value="我要参与" style="width:90%" onclick="upload()">
                    }
                    else
                    {
                        <input name="" type="button" class="button" value="查看我的" style="width:90%" onclick="detail()">
                    }
                }

            </td>
        </tr>
    </table>
</div>
